<!--
  - Copyright (C) 2018-2019
  - All rights reserved, Designed By www.samfeng.com
  - 注意：
  - 本软件为www.samfeng.com开发研制，项目使用请保留此说明
-->
<template>
  <div>
    <avue-crud ref="product"
                :page="page"
                :data="tableData"
                :table-loading="tableLoading"
                :option="tableOption2"
                v-model="productform"
                @on-load="getProductPage"
                @refresh-change="refreshProductChange"
                @search-change="productSearchChange"
                @selection-change="productSelectionChange">
    </avue-crud>
    <el-row class="pt15">
      <el-col  style="float:right">     
          <el-button size="small" type="primary" @click.native="selectClick" icon="el-icon-check">确定</el-button>
          <el-button size="small" @click.native="closeClick" icon="el-icon-close">取消</el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import {tableOption2} from '@/const/crud/erp/product_product'
  export default {
    name: 'productSelect',
    data() {
      return {
        tableOption2:tableOption2
      }
    },
    props: {
      productform: null,
      tableData: null,
      tableLoading: null,
      page: null,
      paramsSearch: null,
    },
    methods: {
      selectClick() {
        this.$emit('selectClick')
      },
      closeClick() {
         this.$emit('closeClick')
      },
      productSelectionChange(row){
        this.$emit('productSelectionChange', row)      
      },     
      getProductPage(page, params) {
        this.$emit('getProductPage', {page, params})
      },
      /**
       * 刷新回调
       */
      refreshProductChange(page) {
        this.$emit('refreshProductChange', page)
      },
      productSearchChange(params,done) {
        this.$emit('productSearchChange', {params,done})
      }
    }
  }
</script>
